package org.mis6323.data.dao.impl;

import org.apache.ibatis.session.SqlSession;
import org.mis6323.data.dao.CarrierDao;
import org.mis6323.data.model.Carrier;

/**
 * Created by IntelliJ IDEA.
 * User: Linh Vo
 * Date: 3/27/11
 * Time: 2:50 PM
 * To change this template use File | Settings | File Templates.
 */
public class DatabaseCarrierDaoImpl implements CarrierDao{

   SqlSession sqlSession;
    public void setSqlSession(SqlSession session){
        this.sqlSession=session;
    }

    public void createCarrier(Carrier carrier) {
        this.sqlSession.insert("insertCarrier", carrier);
    }

    public void deleteCarrier(Long carrierID) {
        this.sqlSession.delete("deleteCarrier",carrierID);
    }

    public void updateCarrier(Carrier carrier) {
        this.sqlSession.update("updateCarrier",carrier);
    }

    public Carrier searchCarrierID(Long carrierID) {
        return (Carrier) this.sqlSession.selectOne("searchCarrierById",carrierID);
    }
}
